package com.company.观察者模式2;

import java.util.Observable;
import java.util.Observer;

public class Productor implements Observer {

    @Override
    public void update(Observable o, Object arg) {
        int var=(Integer)arg;
        if (var>0){
            System.out.println("赚钱了");
        }else if (var<0){
            System.out.println("少亏就是赚");
        }
    }
}
